	

-- D:\GOA\reslibrary\templete\res\area\area.pad.lua.xsl
					
gr_module("gm_xinbanchunzhongyun")

mainfirstareaArea = inherit(GmCtrl.ControlBase):name("mainfirstareaArea")

mainfirstareaArea.init = function (self,parent,aid)

	local top = self
	local fid = aid or "mainfirstareaArea"
	GmCtrl.ControlBase.init(self,parent,fid )


	
	
	
	self.title = nil
		
	-- show1
	self.btmainproduct = self:get_child("btmainproduct")
	self.btmainproduct:set_click(function(link)			
				
		top.hostWindow:showFrame('mainproduct',nil,function(frame)
				
		end)
					  
	end)
	
	-- show1
	self.btmainorder = self:get_child("btmainorder")
	self.btmainorder:set_click(function(link)			
				
		top.hostWindow:showFrame('mainorder',nil,function(frame)
				
		end)
					  
	end)
	
	-- show1
	self.btmainclient = self:get_child("btmainclient")
	self.btmainclient:set_click(function(link)			
				
		top.hostWindow:showFrame('mainclient',nil,function(frame)
				
		end)
					  
	end)
	
	-- show1
	self.btmainformula = self:get_child("btmainformula")
	self.btmainformula:set_click(function(link)			
				
		top.hostWindow:showFrame('mainformula',nil,function(frame)
				
		end)
					  
	end)
	
	-- show1
	self.btmaingallery = self:get_child("btmaingallery")
	self.btmaingallery:set_click(function(link)			
				
		top.hostWindow:showFrame('maingallery',nil,function(frame)
				
		end)
					  
	end)
		
	
	
		
	
	self.sorkey = ''

	self.page = 0
	
	self:show_scroll_bar(true)
		

	
	

end


mainfirstareaArea.on_show = function(self,key)

	
	if self.ctrls and self.ctrls.on_show then
		self.ctrls:on_show(key)
	end
	
	if self.ctrls and self.ctrls.on_show then
		self.ctrls:on_show(key)
	end
	
	if self.ctrls and self.ctrls.on_show then
		self.ctrls:on_show(key)
	end
	
	if self.ctrls and self.ctrls.on_show then
		self.ctrls:on_show(key)
	end
	
	if self.ctrls and self.ctrls.on_show then
		self.ctrls:on_show(key)
	end
	
	
end


mainfirstareaArea.callback = function(self,key,tb)
	local attrs = self.mgr:GetAttrs()
  if tb.act == 'prev' and table.eq(attrs,tb) then		
		self.mgr:SetPageDirty(true)
		self:clean()
		self:init_item_data()
		self.toploading:set_loading(false)
		self:updatetick(true)
		return true
	else
		print('mainfirstareaArea callback error ',key,tb)
	end
end



mainfirstareaArea.set_data = function(self,data)
	self.data = data
	
	if self.ctrls and self.ctrls.set_data then
		self.ctrls:set_data(data)
	end
		
	if self.ctrls and self.ctrls.set_data then
		self.ctrls:set_data(data)
	end
		
	if self.ctrls and self.ctrls.set_data then
		self.ctrls:set_data(data)
	end
		
	if self.ctrls and self.ctrls.set_data then
		self.ctrls:set_data(data)
	end
		
	if self.ctrls and self.ctrls.set_data then
		self.ctrls:set_data(data)
	end
		
	
	for a,b in pairs(data) do
		if self[a] ~= nil and type(self[a]) == 'table' and self[a].set_text ~= nil then
			self[a]:set_text(tostring(b))
		end
	end
	
end



mainfirstareaArea.set_title = function(self,value)
	self.title = value
end
		